package com.IO.IODemo01;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class A09Copy {
    public static void main(String[] args) throws IOException {
        /*
         * read(byte[] ) 一次读取一个数组
         * */
        long l = System.currentTimeMillis();
        FileInputStream fis = new FileInputStream("D:\\TestFile\\Copy\\A\\test.mp4");
        FileOutputStream fos = new FileOutputStream("D:\\TestFile\\Copy\\B\\Best.mp4");
        byte[] b = new byte[1024 * 1024 * 5];
        int n;
        while ((n = fis.read(b)) != -1) {
            fos.write(b, 0, n);
        }
        fos.close();
        fis.close();
        long l1 = System.currentTimeMillis();
        System.out.println(l1 - l);
    }
}
